<?php

/* 
 * The include path may change 
 * depending on PHPCodeProvider.php location. 
 */

include_once 'Classes/PHPCodeProvider.php';

/*
 * Create an instance of the CodeGeneratorOptions class
 * using the default options for code generation.
 */

$options = new CodeGeneratorOptions();

/*
 * Create an instance of the IndentedTextWriter.
 * After the generateCodeFromCodeUnit call
 * $writer will hold the generated code.
 */

$writer = new IndentedTextWriter();

/*
 * Create an instance of the CodeUnit class.
 * $codeUnit is the root object of the code model.
 */

$codeUnit = new CodeUnit();

/*
 * Add a namespace to the code unit
 */

$codeUnit->Namespaces->add(new CodeNamespace('myNamespace'));

/*
 * Generate the code and output the result.
 */

$provider = new PHPCodeProvider();
$provider->generateCodeFromCodeUnit($codeUnit, $writer, $options);
echo 
    '<pre>' . str_replace(
        '<br />', '', highlight_string($writer->get_String(), true)) . 
    '<pre/>';


?>
